<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        /**
         *   String()的使用
         *   1. 如果有toString方法，则调用toSting（）方法返回对应的值
         *   2. 如果值是null，则返回字符串"null"
         *   3. 如果值是 undefined， 则返回字符串"undefined"
         */
        let value1 = 10;
        let value2 = true;
        let value3 = null;
        let value4 ;

        console.log(String(value1))//10
        console.log(String(value2))//true
        console.log(String(value3))//null
        console.log(String(value4))//undefined

        console.log(typeof String(value3));//string
        // console.log(typeof String(value4));//string

        let o = new Object();
        console.log(o.toLocaleString());
        console.log(o.toString());


    </script>
</head>
<body>

</body>
</html>